<?php


namespace app\common\lib;


use Pheanstalk\Pheanstalk;
use think\facade\Config;

class ZhyxBeanstalkd
{
    public $beansTalk = "";
    private static $instance = null;

    public static function getInstance(): ?ZhyxBeanstalkd
    {
        if (self::$instance === null) {
            self::$instance = new self();
        }
        return self::$instance;
    }

    final private function __construct()
    {
        $config = Config::get("beanstalkd");
        $this->beansTalk = Pheanstalk::create($config["host"], $config["port"]);

    }

    final public function __clone()
    {
        // TODO: Implement __clone() method.
    }
}